<template>
  <div id="app">
	<!-- 重点 -->
    <router-view></router-view> <!-- 这里是用来显示路由对应的组件内容的地方 -->

  </div>
</template>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>

<script>
export default {
  data() {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  },
  created() {
    // 获取用户信息
    this.$store.dispatch('getUserInfo')
  },
  mounted() {
    this.setTitleIcon()
  },
  methods: {
    setTitleIcon(){
      var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
      link.type = 'image/x-icon';
      link.rel = 'shortcut icon';
      link.href = 'https://sky-out-cxg.oss-cn-beijing.aliyuncs.com/img_1.png'; // 图片放public目录
      document.getElementsByTagName('head')[0].appendChild(link);
      document.getElementsByTagName("title")[0].innerText = '小黑子管理系统';
    }
  }
}
</script>
